#!usr/bin/env python  
# -*- coding:utf-8 _*-
""" 
@author:robot
@file: sync_javascript_node.py 
@version:
@time: 2022/01/07 
"""
from TapClientCore.T04_logic.Dag01.node.node_base import NodeBase, TapdataNoThisDataSource


class SyncSinkJavaScriptNode(NodeBase):

    def __init__(self, name, script: str):
        self.id = self.newId
        self.name = name
        self.script = script
        self.attribute = self.sole()

    def sole(self):
        this_node = {
            'id': self.id,
            'inputLanes': [],
            'outputLanes': [],
            'name': self.name,
            'type': 'js_processor',
            'script': self.script
        }
        return this_node
